package acwing._1_1AlgorithmBasic._4Math;
/**
 * @Project : AlgorithmLearning
 * @Package : ACWing._1_1AlgorithmBasic._4Math
 * @File : Q0871.java
 * @Author : WangRuoyu
 * @Date : 2023/4/4 15:38
 */

import java.io.*;
import java.util.HashMap;

public class Q0871 {

    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        BufferedWriter wr = new BufferedWriter(new OutputStreamWriter(System.out));
        String[] words = br.readLine().split(" ");
        int n = Integer.parseInt(words[0]);

        HashMap<Integer, Integer> map = new HashMap<>();
        for (int i = 0; i < n; ++i) {
            words = br.readLine().split(" ");
            int k = Integer.parseInt(words[0]);
            for (int j = 2; j <= k / j; ++j) {
                if (k % j == 0) {
                    if (!map.containsKey(j)) {
                        map.put(j, 0);
                    }
                    while (k % j == 0) {
                        map.put(j, map.get(j) + 1);
                        k /= j;
                    }
                }
            }
            if (k > 1) {
                if (!map.containsKey(k)) {
                    map.put(k, 0);
                }
                map.put(k, map.get(k) + 1);
            }
        }

        long res = 1;
        final long MOD = 1000000007;
        for (Integer key : map.keySet()) {
            long tmp = 0;
            for (int i = 0; i <= map.get(key); ++i) {
                tmp = (tmp * key + 1) % MOD;
            }
            res = (res * tmp) % MOD;
        }

        wr.write(res + "\n");
        wr.flush();
    }
}


